<?php
 Session_Start () ;
 Include ($_SESSION ["repertoire_config"]."/garennes.cfg") ;
 Include ($_SESSION ["repertoire_config"]."/init.php") ;
 Include ($_SESSION ["repertoire_config"]."/module_vie_scolaire.php") ;
 Include ("../include/config.inc") ;
 verif_droits ($droit_courant, $_SESSION ["code"]) ;
 $id_utilisateur = utilparcode ($_SESSION ["code"]) ;
 
 Include ("../../include/var_temp.inc") ;
 
 $titre = "Self de la Semaine" ;
 $titre_affichage = "Self de la <FONT COLOR='#0000FF'>Semaine</FONT>" ;
 $choix = "self_semaine_".$id_utilisateur ;
 $page = "./vs_affiche_self_semaine.php" ;
 $type = 1 ;
 
 $resultats = SQL_commande ("SELECT * FROM menus WHERE numero='".$droit_courant."' AND ordre='0'", $id_sql) ;
 $l = SQL_tableau_associatif ($resultats, "") ;
 Echo "<HTML><HEAD>" ;
 entete_html ("Garennes", "", 1) ;
 Echo styles ("none", "none", "none", $l ["nom"], "none") ;
 Echo "</HEAD>" ;
 Echo "<BODY BACKGROUND=\"../images/fond.png\" TEXT=\"".$theme [0][4]."\" onContextMenu=\"return false\">" ;
 Echo affiche_travail ("travail_menu", "<FONT SIZE='+1'><B>".$titre_affichage.".</B>", $l ["couleur_fond"]) ;
 
 Echo "<BR>" ;
 Echo "<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\" ALIGN=\"CENTER\">" ;
 
 // Affichage des parametres
 $param = recup_parametrage ($choix) ;
 Echo "<TR><TD>" ;
 Echo "<FORM ACTION=\"".$page."\" METHOD=\"POST\">\n" ;
 Echo "<INPUT TYPE=\"HIDDEN\" NAME=\"type\" VALUE=\"".$type."\">\n" ;
 Echo "<INPUT TYPE=\"HIDDEN\" NAME=\"choix\" VALUE=\"".$choix."\">\n" ;
 Echo "<INPUT TYPE=\"HIDDEN\" NAME=\"titre\" VALUE=\"".$titre."\">\n" ;
 Echo "<TABLE BORDER=\"1\" BGCOLOR=\"".$l ["couleur_fond"]."\" CELLSPACING=\"0\" CELLPADDING=\"0\" ALIGN=\"CENTER\" STYLE=\"border:1px solid #000000;border-collapse:collapse\">" ;
 Echo "<TR>\n" ;
 Echo "<TD>\n" ;
 Echo "<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\" ALIGN=\"CENTER\">\n" ;
 Echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n" ;
 Echo "<TR>\n" ;
 Echo "<TD ALIGN=\"RIGHT\">&nbsp;<B>Date&nbsp;de&nbsp;d&eacute;part</B>&nbsp;:&nbsp;</TD>\n" ;
 Echo "<TD ALIGN=\"LEFT\">\n" ;
 Echo "<SELECT NAME=\"jour\">\n" ;
 For ($i = 1 ; $i < 32 ; $i++)
  {
   Echo "<OPTION VALUE=\"".$i."\"" ;
   If ($i == $param ["jour"][0]) { Echo " SELECTED" ; }
   Echo ">".$i."</OPTION>\n" ;
  }
 Echo "</SELECT>" ;
 Echo "<SELECT NAME=\"mois\">\n" ;
 For ($i = 1 ; $i < 13 ; $i++)
  {
   Echo "<OPTION VALUE=\"".$i."\"" ;
   If ($i == $param ["mois"][0]) { Echo " SELECTED" ; }
   Echo ">".$nom_mois [$i]."</OPTION>\n" ;
  }
 Echo "</SELECT>" ;
 Echo "<SELECT NAME=\"annee\">\n" ;
 For ($i = Date ("Y")-1 ; $i < Date("Y")+2 ; $i++)
  {
   Echo "<OPTION VALUE=\"".$i."\"" ;
   If ($i == $param ["annee"][0]) { Echo " SELECTED" ; }
   Echo ">".$i."</OPTION>\n" ;
  }
 Echo "</SELECT>&nbsp;" ;
 Echo "</TD>\n" ;
 Echo "</TR>\n" ;
 Echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n" ;
 
 Echo "<TR>\n" ;
 Echo "<TD ALIGN=\"RIGHT\">&nbsp;<B>Dur&eacute;e</B>&nbsp;:&nbsp;</TD>\n" ;
 Echo "<TD ALIGN=\"LEFT\">\n" ;
 Echo "<SELECT NAME=\"duree\">\n" ;
 For ($i = 1 ; $i < 4 ; $i++)
  {
   Echo "<OPTION VALUE=\"".($i*7)."\"" ;
   If ($i*7 == $param ["duree"][0]) { Echo " SELECTED" ; }
   Echo ">".$i."&nbsp;semaine" ; If ($i > 1) { Echo "s" ; }
   Echo "</OPTION>\n" ;
  }
 Echo "</SELECT>&nbsp;" ;
 Echo "</TD>\n" ;
 Echo "</TR>\n" ;
 Echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n" ;
 
 Echo "<TR>\n" ;
 Echo "<TD ALIGN=\"RIGHT\">&nbsp;<B>Premi&egrave;re&nbsp;partie&nbsp;:&nbsp;De&nbsp;A&nbsp;&agrave;</B>&nbsp;</TD>\n" ;
 Echo "<TD ALIGN=\"LEFT\">\n" ;
 Echo "<SELECT NAME=\"lettre\">\n" ;
 //Echo "<OPTION VALUE=\"\">Aucune</OPTION>\n" ;
 For ($i = 2 ; $i <= 25 ; $i++)
  {
   Echo "<OPTION VALUE=\"".$i."\"" ;
   If ($param ["lettre"][0] == $i) { Echo " SELECTED" ; }
   Echo ">".Chr ($i+64)."</OPTION>\n" ;
  }
 Echo "</SELECT><B>.&nbsp;Deuxi&egrave;me&nbsp;partie&nbsp;:&nbsp;Tout&nbsp;le&nbsp;reste&nbsp;jusqu'&agrave;&nbsp;Z.</B>\n" ;
 Echo "</TD>\n" ;
 Echo "</TR>\n" ;
 Echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n" ;
 
 Echo "<TR>\n" ;
 Echo "<TD ALIGN=\"RIGHT\">&nbsp;<B>Groupe&nbsp;demi-pension</B>&nbsp;:&nbsp;</TD>\n" ;
 Echo "<TD ALIGN=\"LEFT\">\n" ;
 Echo "<SELECT NAME=\"grp_dp\">\n" ;
 Echo "<OPTION VALUE=\"0\">Tous</OPTION>\n" ;
 $resultats = SQL_commande ("SELECT * FROM vs_noms_groupes_dp", $id_sql) ;
 For ($i = 0 ; $i < SQL_nbr_lignes ($resultats) ; $i++)
  {
   $ligne = SQL_tableau_associatif ($resultats, "") ;
   Echo "<OPTION VALUE=\"".$ligne ["id_nom_groupe_dp"]."\"" ;
   If ($param ["grp_demi_pension"][0] == $ligne ["id_nom_groupe_dp"]) { Echo " SELECTED" ; }
   Echo ">".$ligne ["nom"]."</OPTION>\n" ;
  }
 Echo "</SELECT>\n" ;
 Echo "</TD>\n" ;
 Echo "</TR>\n" ;
 Echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n" ;
 
 Echo "<TR>\n" ;
 Echo "<TD ALIGN=\"RIGHT\" vALIGN=\"TOP\">&nbsp;<B>R&eacute;gime</B>&nbsp;:&nbsp;</TD>\n" ;
 Echo "<TD ALIGN=\"LEFT\" vALIGN=\"MIDDLE\">\n" ;
 $resultats = SQL_commande ("SELECT * FROM types_regimes ORDER BY code", $id_sql) ;
 For ($i = 0 ; $i < SQL_nbr_lignes ($resultats) ; $i++)
  {
   $ligne = SQL_tableau_associatif ($resultats, "") ;
   Echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"regime_".$ligne ["code"]."\"" ;
   If ($param ["regime"][$ligne ["code"]] == 1) { Echo " CHECKED" ; }
   Echo ">".$ligne ["nom_long"]."&nbsp;" ;
   If ($i < SQL_nbr_lignes ($resultats)-1) { Echo "<BR>\n" ; } Else { Echo "\n" ; }
  }
 Echo "</TD>\n" ;
 Echo "</TR>\n" ;
 Echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n" ;
 
 Echo "<TR>\n" ;
 Echo "<TD ALIGN=\"RIGHT\" vALIGN=\"TOP\">&nbsp;<B>Jours&nbsp;valides</B>&nbsp;:&nbsp;</TD>\n" ;
 Echo "<TD ALIGN=\"LEFT\" vALIGN=\"MIDDLE\">\n" ;
 Echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"jo_1\"" ; If ($param ["jo"][1] == 1) { Echo " CHECKED" ; }
 Echo ">Lundi<BR>\n" ;
 Echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"jo_2\"" ; If ($param ["jo"][2] == 1) { Echo " CHECKED" ; }
 Echo ">Mardi<BR>\n" ;
 Echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"jo_3\"" ; If ($param ["jo"][3] == 1) { Echo " CHECKED" ; }
 Echo ">Mercredi<BR>\n" ;
 Echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"jo_4\"" ; If ($param ["jo"][4] == 1) { Echo " CHECKED" ; }
 Echo ">Jeudi<BR>\n" ;
 Echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"jo_5\"" ; If ($param ["jo"][5] == 1) { Echo " CHECKED" ; }
 Echo ">Vendredi<BR>\n" ;
 Echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"jo_6\"" ; If ($param ["jo"][6] == 1) { Echo " CHECKED" ; }
 Echo ">Samedi\n" ;
 Echo "</TD>\n" ;
 Echo "</TR>\n" ;
 Echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n" ;
 Echo "</TABLE>\n" ;
 Echo "</TD>\n" ;
 Echo "</TR>\n" ;
 Echo "</TABLE>\n" ;
 Echo "</TD>\n" ;
 
 // Espace entre les tableaux
 Echo "<TD>&nbsp;&nbsp;</TD>\n" ;
 
 // Parametres
 affiche_parametres_formatage () ;
 
 Echo "</TR>\n" ;
 Echo "</TABLE>\n" ;
 Echo "</TD>\n" ;
 Echo "</TR>\n" ;
 Echo "<TR><TD COLSPAN=\"3\">&nbsp;</TD></TR>\n" ;
 Echo "<TR>\n" ;
 Echo "<TD ALIGN=\"CENTER\" COLSPAN=\"3\">\n" ;
 Echo "<INPUT TYPE=\"SUBMIT\" NAME=\"partie_1\" VALUE=\" Premi&egrave;re partie \">&nbsp;&nbsp;" ;
 Echo "&nbsp;&nbsp;&nbsp;<INPUT TYPE=\"SUBMIT\" NAME=\"partie_2\" VALUE=\" Deuxi&egrave;me partie \">\n" ;
 Echo "</TD>\n" ;
 Echo "</TR>\n" ;
 Echo "</FORM>\n" ;

 Echo "  </TABLE>" ;
 Echo " </BODY></HTML>" ;
?>